const border = require('../tw-lib-base/border/props')

module.exports = {
  value: {
    type: String,
    default: '',
    name: '选中标签名称',
    filedType: 'value',
    dataSource: {
      from: 'list',
      type: 'array',
      labelKey: 'label',
      valueKey: 'value'
    }
  },

  list: {
    type: Object,
    default: function () {
      // 兼容的数据结构，name与value相等
      // return ['Tab名称1', 'Tab名称2']
      return [
        {
          name: 'Tab名称1',
          value: '1'
        },
        {
          name: 'Tab名称2',
          value: '2'
        }
      ]
    },
    name: 'tab列表',
    filedType: 'api'
  },

  columns: {
    type: String,
    default: '2',
    name: '列数',
    nameTip: '每行显示多少项',
    filedType: 'string'
  },

  type: {
    type: Array,
    default: 'card',
    name: '标签样式类型',
    filedType: 'select',
    options: [
      {
        name: '基本样式',
        value: ''
      },
      {
        name: '选项卡样式',
        value: 'card'
      },
      {
        name: '卡片式',
        value: 'border-card'
      }
    ]
  },

  height: {
    type: String,
    default: '40px',
    name: '高度',
    filedType: 'string'
  },

  backgroundColor: {
    type: String,
    default: '',
    name: '标签容器背景颜色',
    filedType: 'color'
  },

  cardContentBg: {
    type: String,
    default: '',
    name: '标签内容区背景色',
    filedType: 'color',
    vif: {
      key: 'type',
      value: '',
      operator: 'border-card'
    }
  },

  cardContentBoxShadow: {
    type: String,
    default: '#f5f7fa',
    name: '标签内容区投影',
    filedType: 'color',
    vif: {
      key: 'type',
      value: 'border-card'
    }
  },

  cardItemBg: {
    type: String,
    default: '#f5f7fa',
    name: '标签背景色',
    filedType: 'color',
    vif: {
      key: 'type',
      value: '',
      operator: '!=='
    }
  },

  fontSize: {
    type: String,
    default: '14px',
    name: '字体大小',
    filedType: 'string'
  },

  textBold: {
    type: Boolean,
    default: false,
    name: '文本加粗',
    filedType: 'switch'
  },

  color: {
    type: String,
    default: '#333',
    name: '文本颜色',
    filedType: 'color'
  },

  tabMarginRight: {
    type: String,
    default: '',
    name: '标签间隔',
    filedType: 'string'
  },

  spacing: {
    type: String,
    default: '40px',
    name: '标签内边距',
    filedType: 'string'
  },

  barHeight: {
    type: String,
    default: '2px',
    name: '下划线高度',
    filedType: 'string',
    vif: {
      key: 'type',
      value: ''
    }
  },

  barBgColor: {
    type: String,
    default: '#e4e7ed',
    name: '下划线颜色',
    filedType: 'color',
    vif: {
      key: 'type',
      value: ''
    }
  },

  noBar: {
    type: Boolean,
    default: false,
    name: '隐藏下划线',
    filedType: 'switch',
    vif: {
      key: 'type',
      value: ''
    }
  },

  activeColor: {
    type: String,
    default: '#ffffff',
    name: '选中文本颜色',
    filedType: 'color'
  },

  activeTextBold: {
    type: Boolean,
    default: false,
    name: '选中文本加粗',
    filedType: 'switch'
  },

  activeBarHeight: {
    type: String,
    default: '2px',
    name: '选中项下划线高度',
    filedType: 'string',
    vif: {
      key: 'type',
      value: ''
    }
  },

  activeBarColor: {
    type: String,
    default: '#409eff',
    name: '选中项下划线颜色',
    filedType: 'color',
    vif: {
      key: 'type',
      value: ''
    }
  },

  cardBg: {
    type: String,
    default: '#f5f7fa',
    name: '标签容器背景色',
    filedType: 'color',
    vif: {
      key: 'type',
      value: '',
      operator: 'border-card'
    }
  },

  cardActiveColor: {
    type: String,
    default: '',
    name: '选中标签背景色',
    filedType: 'color'
  },

  cardBorderColor: {
    type: String,
    default: '#e4e7ed',
    name: '标签区边框色',
    filedType: 'color'
  },

  cardMarginBottom: {
    type: String,
    default: '',
    name: '标签下边距',
    filedType: 'string'
  },

  tabItemRadius: {
    type: String,
    default: '',
    name: '标签圆角',
    filedType: 'string'
  },

  icons: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '图标列表',
    filedType: 'file',
    limit: 100,
    maxSize: 1024
  },

  hoverIcons: {
    type: Array,
    default () {
      return [
      ]
    },
    name: '滑过图标列表',
    filedType: 'file',
    limit: 100,
    maxSize: 1024
  },

  iconHeight: {
    type: String,
    default: '15px',
    name: '图标高度',
    filedType: 'string'
  },

  ...border,

  autoToggleTime: {
    type: String,
    default: '',
    name: '自动切换时间(ms)',
    nameTip: '指定该值后，tab将按指定时间切换标签',
    filedType: 'string'
  },

  preventToggle: {
    type: Boolean,
    default: true,
    name: '手动点击tab标签后，停止自动切换',
    filedType: 'switch',
    vif: {
      key: 'autoToggleTime',
      value: '',
      operator: '!=='
    }
  }
}

// Helvetica Neue,,宋体,Arial,Helvetica,sans-serif
